﻿    // silverlight popup control
    var silverlightPopup = null;
    function pluginLoadedPopup(sender,args)
    {
        silverlightPopup = document.getElementById('SilverlightPopup');
    }
    
    
    // JavaScript bridge class used to pass data to the popup
    function SLPopupData(x,y,xaml){
	    this.x=x;
	    this.y=y;
	    this.xaml=xaml;
	    this.shown = false;
    }
    SLPopupData.prototype.x=this.x;
    SLPopupData.prototype.y=this.y;
    SLPopupData.prototype.xaml=this.xaml;
    SLPopupData.prototype.shown = this.shown;
    SLPopupData.prototype.Show = function()
    {
       // hide previous popup if we have one
       if (this.shown)
            this.Hide();
       silverlightPopup.content.popup.ShowPopup(this);
       this.shown = true;
    }
    SLPopupData.prototype.Hide = function()
    {
        silverlightPopup.content.popup.HidePopup();    
        this.shown = false;
    }